﻿@{
    ViewBag.Title = "Database";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
<ul class="breadcrumb" style="margin-bottom: 7px;">
    <li><a href="#">首页</a> <span class="divider">/</span></li>
    <li><a href="#">系统管理</a> <span class="divider">/</span></li>
    <li class="active">数据库管理</li>
</ul>
<div class="demo-content">
    <div id="tab"></div>
    <div class="row">
        <div class="span11 bordered">
            <div style="padding: 20px">
                <div id="form1" style="display: none">
                    <form>
                        <table cellpadding="5px">
                            <tr>
                                <td>SQL语句：</td>
                                <td>
                                    <textarea style="width: 280px"></textarea></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td>
                                    <button class="button button" type="submit">执行</button></td>
                            </tr>
                        </table>
                    </form>
                </div>
                <div id="form2" style="display: none">
                    <form>
                        <table cellpadding="5px">
                            <tr>
                                <td>备份目录：</td>
                                <td>
                                    /<input type="text" value="bak" style="width: 270px" /></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td>
                                    <button class="button button" type="submit">备份</button>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var Tab = BUI.Tab
    var tab = new Tab.Tab({
        render: '#tab',
        elCls: 'nav-tabs',
        autoRender: true,
        children: [
          { text: '执行SQL', value: '1' },
          { text: '备份数据库', value: '2' }
        ]
    });
    tab.on('selectedchange', function (ev) {
        var item = ev.item;
        if (item.get('value') == '1') {
            $('#form1').show();
            $('#form2').hide();
        } else {
            $('#form1').hide();
            $('#form2').show();
        }
    });
    tab.setSelected(tab.getItemAt(0));
</script>
